Skip to content

Refactor Blueprint.register to reduce cyclomatic complexity#5856

Closed
VaksHSE wants to merge 2 commits into
pallets:mainfrom
VaksHSE:feature/refactor-blueprint-register
Closed

Refactor Blueprint.register to reduce cyclomatic complexity#5856
VaksHSE wants to merge 2 commits into
pallets:mainfrom
VaksHSE:feature/refactor-blueprint-register

Conversation

@VaksHSE
Copy link
Copy Markdown

@VaksHSE VaksHSE commented Nov 29, 2025

Refactored Blueprint.register method in src/flask/sansio/blueprints.py.

  • Extracted helper methods:
    _ensure_unique_name,
    _register_static,
    _merge_blueprint_funcs_if_needed,
    _run_deferred_functions,
    _register_cli,
    _register_nested_blueprints,
    _compute_nested_blueprint_options.

  • Reduced cyclomatic complexity from D (23) to A (2).

  • All tests pass: 485 passed, 5 skipped.

@davidism davidism closed this Nov 29, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants